/*
 Navicat Premium Data Transfer

 Source Server         : 本地_mysql
 Source Server Type    : MySQL
 Source Server Version : 80026
 Source Host           : localhost:3306
 Source Schema         : changju

 Target Server Type    : MySQL
 Target Server Version : 80026
 File Encoding         : 65001

 Date: 10/01/2022 14:33:14
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for work_appointment_config
-- ----------------------------
DROP TABLE IF EXISTS `work_appointment_config`;
CREATE TABLE `work_appointment_config` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `start_time` datetime(6) DEFAULT NULL COMMENT '预约开始时间',
  `end_time` datetime(6) DEFAULT NULL COMMENT '预约结束时间',
  `pro_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '项目类别',
  `pro_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '名称',
  `charging_mode` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '收费方式',
  `unit_price` double(10,2) DEFAULT NULL COMMENT '单价',
  `auto_audit` bit(1) DEFAULT NULL COMMENT '自动审核',
  `owner` int DEFAULT NULL COMMENT '所属者',
  `creator` varchar(20) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime(6) DEFAULT NULL COMMENT '创建时间',
  `logical_delete` bit(1) DEFAULT NULL COMMENT '逻辑删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='预约配置';

-- ----------------------------
-- Records of work_appointment_config
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_appointment_notepad
-- ----------------------------
DROP TABLE IF EXISTS `work_appointment_notepad`;
CREATE TABLE `work_appointment_notepad` (
  `id` int NOT NULL COMMENT 'ID',
  `aid` int DEFAULT NULL COMMENT '配置ID',
  `content` varchar(255) DEFAULT NULL COMMENT '内容',
  `contacts` varchar(50) DEFAULT NULL COMMENT '联系人',
  `phone` varchar(20) DEFAULT NULL COMMENT '联系电话',
  `appointment_start_time` datetime(6) DEFAULT NULL COMMENT '预约开始时间',
  `appointment_end_time` datetime(6) DEFAULT NULL COMMENT '预约结束时间',
  `appointment_url` varchar(255) DEFAULT NULL COMMENT '预约图片',
  `creator` varchar(255) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime(6) DEFAULT NULL COMMENT '创建时间',
  `logical_delete` bit(1) DEFAULT NULL COMMENT '逻辑删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='预约记录';

-- ----------------------------
-- Records of work_appointment_notepad
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_assembly_comment
-- ----------------------------
DROP TABLE IF EXISTS `work_assembly_comment`;
CREATE TABLE `work_assembly_comment` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `uid` int DEFAULT NULL COMMENT '用户ID',
  `nid` int DEFAULT NULL COMMENT '通知ID',
  `table_name` varchar(0) DEFAULT NULL COMMENT '表名',
  `content` varchar(2550) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内容',
  `creator` varchar(255) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime(6) DEFAULT NULL COMMENT '创建时间',
  `shumbs_up` int DEFAULT NULL COMMENT '点赞数',
  `logical_delete` bit(1) DEFAULT NULL COMMENT '逻辑删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='评论';

-- ----------------------------
-- Records of work_assembly_comment
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_assembly_notice
-- ----------------------------
DROP TABLE IF EXISTS `work_assembly_notice`;
CREATE TABLE `work_assembly_notice` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '主题',
  `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '内容',
  `thumbs_up_num` int DEFAULT NULL COMMENT '点赞数',
  `follow_num` int DEFAULT NULL COMMENT '关注数',
  `sending_range` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '发送范围',
  `creator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人',
  `create_time` datetime(6) DEFAULT NULL COMMENT '创建时间\r\n',
  `logical_delete` bit(1) NOT NULL DEFAULT b'1' COMMENT '逻辑删除',
  `consignee` varchar(255) DEFAULT NULL COMMENT '收件人',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='信息通知';

-- ----------------------------
-- Records of work_assembly_notice
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_assembly_shumbs_up
-- ----------------------------
DROP TABLE IF EXISTS `work_assembly_shumbs_up`;
CREATE TABLE `work_assembly_shumbs_up` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `cid` int DEFAULT NULL COMMENT '评论ID',
  `uid` int DEFAULT NULL COMMENT '用户ID',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='点赞';

-- ----------------------------
-- Records of work_assembly_shumbs_up
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_assembly_vote
-- ----------------------------
DROP TABLE IF EXISTS `work_assembly_vote`;
CREATE TABLE `work_assembly_vote` (
  `id` int unsigned NOT NULL COMMENT 'ID',
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '主题',
  `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内容',
  `imgurl` varchar(2550) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '图片',
  `alternative` varchar(2550) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备选项',
  `allow_voters` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '投票人',
  `result` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '结果',
  `start_time` datetime(6) DEFAULT NULL COMMENT '开始时间',
  `end_time` datetime(6) DEFAULT NULL COMMENT '结束时间',
  `anonymous` bit(1) DEFAULT NULL COMMENT '匿名',
  `checks` bit(1) DEFAULT NULL COMMENT '多选',
  `remark` varchar(255) DEFAULT NULL COMMENT '说明',
  `creator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `logical_delete` bit(1) DEFAULT b'1' COMMENT '逻辑删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='信息投票';

-- ----------------------------
-- Records of work_assembly_vote
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_assembly_vote_notepad
-- ----------------------------
DROP TABLE IF EXISTS `work_assembly_vote_notepad`;
CREATE TABLE `work_assembly_vote_notepad` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `vote_subject` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '投票人ID',
  `avid` tinyint NOT NULL COMMENT '投票ID',
  `vote_time` datetime(6) NOT NULL COMMENT '投票的时间',
  `vote_target` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '投票的对象',
  `already_cast` bit(1) DEFAULT NULL COMMENT '已投',
  `anonymous` bit(1) DEFAULT NULL COMMENT '匿名',
  `creator` varchar(255) DEFAULT NULL COMMENT '创建人',
  `createtime` datetime DEFAULT NULL COMMENT '创建时间',
  `logical_delete` bit(1) DEFAULT NULL COMMENT '逻辑删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='投票记录';

-- ----------------------------
-- Records of work_assembly_vote_notepad
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_association_menu_role
-- ----------------------------
DROP TABLE IF EXISTS `work_association_menu_role`;
CREATE TABLE `work_association_menu_role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `mid` int DEFAULT NULL,
  `rid` int DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=90 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='角色菜单关联表\r\n';

-- ----------------------------
-- Records of work_association_menu_role
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_association_user_role
-- ----------------------------
DROP TABLE IF EXISTS `work_association_user_role`;
CREATE TABLE `work_association_user_role` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `uid` int DEFAULT NULL,
  `rid` int DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='用户角色关联表';

-- ----------------------------
-- Records of work_association_user_role
-- ----------------------------
BEGIN;
INSERT INTO `work_association_user_role` (`id`, `uid`, `rid`) VALUES (1, 2, 1);
COMMIT;

-- ----------------------------
-- Table structure for work_community_floor
-- ----------------------------
DROP TABLE IF EXISTS `work_community_floor`;
CREATE TABLE `work_community_floor` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `vid` int DEFAULT NULL COMMENT '小区ID',
  `coordinate` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '楼号坐标',
  `floor_num` varchar(50) DEFAULT NULL COMMENT '楼号',
  `disable` bit(1) DEFAULT NULL COMMENT '启用',
  `logical_delete` bit(1) NOT NULL DEFAULT b'0' COMMENT '逻辑删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='楼号';

-- ----------------------------
-- Records of work_community_floor
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_community_house
-- ----------------------------
DROP TABLE IF EXISTS `work_community_house`;
CREATE TABLE `work_community_house` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `vid` int DEFAULT NULL COMMENT '小区ID',
  `fid` int DEFAULT NULL COMMENT '楼号ID',
  `uid` int DEFAULT NULL COMMENT '单元ID',
  `level` tinyint unsigned DEFAULT NULL COMMENT '楼层',
  `size` double(10,2) DEFAULT NULL COMMENT '大小',
  `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '类型',
  `house_num` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '门牌号',
  `creator` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `disable` bit(1) DEFAULT b'1' COMMENT '启用',
  `logical_delete` bit(1) DEFAULT b'0' COMMENT '逻辑删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='房屋';

-- ----------------------------
-- Records of work_community_house
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_community_unit
-- ----------------------------
DROP TABLE IF EXISTS `work_community_unit`;
CREATE TABLE `work_community_unit` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `vid` int DEFAULT NULL COMMENT '小区ID',
  `fid` int DEFAULT NULL COMMENT '楼号ID',
  `unit_num` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '单元号',
  `coordinate` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '坐标',
  `disable` bit(1) DEFAULT NULL COMMENT '启用',
  `logical_delete` bit(1) DEFAULT NULL COMMENT '逻辑删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='单元';

-- ----------------------------
-- Records of work_community_unit
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_community_village
-- ----------------------------
DROP TABLE IF EXISTS `work_community_village`;
CREATE TABLE `work_community_village` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(30) NOT NULL COMMENT '小区名字',
  `v_province` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '所在省',
  `v_city` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '所在市',
  `v_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '所在地区',
  `v_detailed_location` varchar(255) DEFAULT NULL COMMENT '详细地区',
  `contacts` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '联系人',
  `phone` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '联系方式',
  `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '邮箱',
  `households` int DEFAULT NULL COMMENT '户数',
  `coordinate` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '小区坐标',
  `engineer` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '工程商',
  `updator` varchar(50) DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `creator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人',
  `createtime` varchar(0) DEFAULT NULL COMMENT '创建时间',
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注',
  `disable` bit(1) DEFAULT NULL COMMENT '状态',
  `logical_delete` bit(1) DEFAULT NULL COMMENT '逻辑删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='社区';

-- ----------------------------
-- Records of work_community_village
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_coordinate
-- ----------------------------
DROP TABLE IF EXISTS `work_coordinate`;
CREATE TABLE `work_coordinate` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `name` varchar(0) NOT NULL COMMENT '名称',
  `coordinate` varchar(50) NOT NULL COMMENT '坐标',
  `parentId` int DEFAULT NULL COMMENT '父ID',
  `remark` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '其他备注说明',
  `creator` varchar(255) DEFAULT NULL COMMENT '创建人',
  `createtime` datetime DEFAULT NULL COMMENT '创建时间',
  `logical_delete` bit(1) DEFAULT NULL COMMENT '逻辑删除',
  `owner` int DEFAULT NULL COMMENT '所属者',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='坐标';

-- ----------------------------
-- Records of work_coordinate
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_cost_config
-- ----------------------------
DROP TABLE IF EXISTS `work_cost_config`;
CREATE TABLE `work_cost_config` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `name` varchar(50) DEFAULT NULL COMMENT '费用名称',
  `charging_mode` tinyint(1) NOT NULL DEFAULT '1' COMMENT '收费模式',
  `estimate_time` double(10,2) DEFAULT NULL COMMENT '预计时间',
  `unit_price` double(10,2) NOT NULL COMMENT '单价',
  `owner` int unsigned DEFAULT NULL COMMENT '所属者',
  `creator` varchar(255) DEFAULT NULL COMMENT '创建人',
  `createtime` datetime DEFAULT NULL COMMENT '创建时间',
  `logical_delete` bit(1) DEFAULT b'0' COMMENT '逻辑删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='费用配置';

-- ----------------------------
-- Records of work_cost_config
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_cost_notepad
-- ----------------------------
DROP TABLE IF EXISTS `work_cost_notepad`;
CREATE TABLE `work_cost_notepad` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `category` int NOT NULL COMMENT '类目',
  `payable` double(10,2) NOT NULL COMMENT '应付金额',
  `actual_pay` bit(1) NOT NULL DEFAULT b'1' COMMENT '实付金额',
  `invoice` bit(1) NOT NULL DEFAULT b'1' COMMENT '已开票',
  `cost_section` varchar(255) NOT NULL COMMENT '费用区间',
  `creator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人',
  `create_time` datetime(6) NOT NULL COMMENT '创建时间',
  `logical_delete` bit(1) NOT NULL DEFAULT b'0' COMMENT '逻辑删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='费用记录\r\n';

-- ----------------------------
-- Records of work_cost_notepad
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_menu
-- ----------------------------
DROP TABLE IF EXISTS `work_menu`;
CREATE TABLE `work_menu` (
  `id` int NOT NULL AUTO_INCREMENT,
  `url` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `path` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `component` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `iconCls` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `keepAlive` tinyint(1) DEFAULT NULL,
  `requireAuth` tinyint(1) DEFAULT NULL,
  `parentId` int DEFAULT NULL,
  `enabled` tinyint(1) DEFAULT '1',
  `is_web` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0是phone 1是web',
  `orderNum` tinyint(1) DEFAULT NULL COMMENT '排序',
  `createtime` datetime DEFAULT NULL COMMENT '创建时间',
  `updated` datetime DEFAULT NULL COMMENT '更新时间',
  `creator` varchar(255) DEFAULT NULL COMMENT '创建人',
  `is_delete` tinyint(1) DEFAULT NULL COMMENT '0是未删除1是已删除',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `parentId` (`parentId`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=66 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='菜单表';

-- ----------------------------
-- Records of work_menu
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_message
-- ----------------------------
DROP TABLE IF EXISTS `work_message`;
CREATE TABLE `work_message` (
  `id` int NOT NULL AUTO_INCREMENT,
  `category` tinyint DEFAULT NULL COMMENT '分类',
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '标题',
  `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内容',
  `read` bit(1) DEFAULT NULL COMMENT '已读',
  `money` double(10,2) DEFAULT NULL COMMENT '金额',
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注',
  `creator` varchar(255) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `logical_delete` bit(1) DEFAULT NULL COMMENT '逻辑删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='消息通知';

-- ----------------------------
-- Records of work_message
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_persistent_logins
-- ----------------------------
DROP TABLE IF EXISTS `work_persistent_logins`;
CREATE TABLE `work_persistent_logins` (
  `username` varchar(64) NOT NULL,
  `series` varchar(64) NOT NULL,
  `token` varchar(64) NOT NULL,
  `last_used` timestamp NOT NULL,
  PRIMARY KEY (`series`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='持久化登陆';

-- ----------------------------
-- Records of work_persistent_logins
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_problem_suggestions
-- ----------------------------
DROP TABLE IF EXISTS `work_problem_suggestions`;
CREATE TABLE `work_problem_suggestions` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `phone` varchar(255) DEFAULT NULL COMMENT '手机号',
  `target` int DEFAULT NULL COMMENT '对象1业委会2物业',
  `content` varchar(2550) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内容',
  `picture` varchar(2550) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '图片',
  `proposer` varchar(20) DEFAULT NULL COMMENT '建议人',
  `creator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人',
  `create_time` datetime(6) DEFAULT NULL COMMENT '创建时间',
  `logical_delete` bit(1) DEFAULT b'0' COMMENT '逻辑删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='问题建议';

-- ----------------------------
-- Records of work_problem_suggestions
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_repair_config
-- ----------------------------
DROP TABLE IF EXISTS `work_repair_config`;
CREATE TABLE `work_repair_config` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '名称',
  `charging_mode` bit(1) DEFAULT NULL COMMENT '收费方式',
  `estimate_time` double(4,2) DEFAULT NULL COMMENT '预计时间',
  `unit_price` double(10,2) DEFAULT NULL COMMENT '单价',
  `detail` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '说明',
  `parentID` int DEFAULT NULL COMMENT '父级的ID',
  `owner` int unsigned DEFAULT NULL COMMENT '所属者',
  `creator` varchar(255) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `logical_delete` bit(1) DEFAULT NULL COMMENT '逻辑删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='维修配置';

-- ----------------------------
-- Records of work_repair_config
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_repair_notepad
-- ----------------------------
DROP TABLE IF EXISTS `work_repair_notepad`;
CREATE TABLE `work_repair_notepad` (
  `id` int NOT NULL AUTO_INCREMENT,
  `srcid` int DEFAULT NULL COMMENT '配置ID',
  `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内容描述',
  `contacts` varchar(50) DEFAULT NULL COMMENT '联系人',
  `phone` varchar(20) DEFAULT NULL COMMENT '联系方式',
  `hid` int DEFAULT NULL COMMENT '房屋ID',
  `repair_image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '图片',
  `appointment_start_time` datetime(6) DEFAULT NULL COMMENT '预约开始时间',
  `appointment_end_time` datetime(6) DEFAULT NULL COMMENT '预约结束时间',
  `estimate_cost` double(10,2) DEFAULT NULL COMMENT '预估费用',
  `actual_start_time` datetime(6) DEFAULT NULL COMMENT '实际开始时间',
  `actual_end_time` datetime(6) DEFAULT NULL COMMENT '实际结束时间',
  `actual_cost` double(10,2) DEFAULT NULL COMMENT '实际费用',
  `creator` varchar(255) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime(6) DEFAULT NULL COMMENT '创建时间',
  `logical_delete` bit(1) DEFAULT NULL COMMENT '逻辑删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='维修记录';

-- ----------------------------
-- Records of work_repair_notepad
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_report
-- ----------------------------
DROP TABLE IF EXISTS `work_report`;
CREATE TABLE `work_report` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `content` varchar(2550) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内容',
  `contacts` varchar(50) DEFAULT NULL COMMENT '联系人',
  `phone` varchar(20) DEFAULT NULL COMMENT '手机',
  `appointment_start_time` datetime(6) DEFAULT NULL COMMENT '预约开始时间',
  `appointment_end_time` datetime(6) DEFAULT NULL COMMENT '预约结束时间',
  `hid` int DEFAULT NULL COMMENT '房屋ID',
  `report_images` varchar(2550) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '图片',
  `creator` varchar(50) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime(6) DEFAULT NULL COMMENT '创建时间',
  `logical_delete` bit(1) DEFAULT NULL COMMENT '逻辑删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='报事';

-- ----------------------------
-- Records of work_report
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_role
-- ----------------------------
DROP TABLE IF EXISTS `work_role`;
CREATE TABLE `work_role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `nameZh` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '角色名称：业主/租户/业委会/物业/系统管理员',
  `status` tinyint(1) DEFAULT NULL COMMENT '状态0不可以用    1可以用',
  `creator` varchar(255) DEFAULT NULL COMMENT '创建人',
  `createtime` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `remark` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `is_delete` tinyint(1) DEFAULT NULL COMMENT '0是未删除1是已删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='角色表';

-- ----------------------------
-- Records of work_role
-- ----------------------------
BEGIN;
INSERT INTO `work_role` (`id`, `name`, `nameZh`, `status`, `creator`, `createtime`, `updated`, `remark`, `is_delete`) VALUES (1, 'houseor', '业主', 1, 'sytem', '2021-12-27 15:06:30', '2021-12-27 15:06:35', NULL, 0);
COMMIT;

-- ----------------------------
-- Table structure for work_travel
-- ----------------------------
DROP TABLE IF EXISTS `work_travel`;
CREATE TABLE `work_travel` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uid` int DEFAULT NULL COMMENT '用户ID',
  `vid` int DEFAULT NULL COMMENT '车ID',
  `travel_time` datetime(6) DEFAULT NULL COMMENT '出行时间',
  `cid` int DEFAULT NULL COMMENT '门坐标id',
  `in_or_out` bit(1) DEFAULT NULL COMMENT '出入',
  `logical_delete` bit(1) DEFAULT NULL COMMENT '逻辑删除',
  `creator` varchar(255) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='出入';

-- ----------------------------
-- Records of work_travel
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_user
-- ----------------------------
DROP TABLE IF EXISTS `work_user`;
CREATE TABLE `work_user` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  `username` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '用户名',
  `password` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户密码',
  `errPassword` int DEFAULT NULL COMMENT '密码错误次数',
  `phone` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '用户手机',
  `phoneFlag` bit(1) DEFAULT b'0' COMMENT '手机是否核验',
  `email` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '用户邮箱',
  `emailFlag` bit(1) DEFAULT b'0' COMMENT '邮箱是否核验',
  `name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '姓名',
  `sex` tinyint(1) DEFAULT '0' COMMENT '性别',
  `identification` tinyint(1) DEFAULT NULL COMMENT '证件类别 1身份证 2护照',
  `idNum` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '证件号码',
  `defaultCityID` int DEFAULT NULL COMMENT '默认家乡城市代码',
  `defaultCity` varchar(25) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '默认家乡城市名字',
  `tokenExptime` datetime DEFAULT '2020-04-01 12:12:12' COMMENT 'token的过期时间',
  `regtime` date NOT NULL COMMENT '注册时间',
  `category` tinyint(1) NOT NULL COMMENT '1.系统管理员2.业委会3.物业4.业主5.业主家庭成员6.租户7.租户家庭成员',
  `owner` int DEFAULT NULL COMMENT '业主ID/租户主ID',
  `enabled` bit(1) NOT NULL DEFAULT b'1' COMMENT '账号可用',
  `userface` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '图像链接',
  `creator` varchar(255) DEFAULT NULL COMMENT '创建人',
  `createtime` datetime DEFAULT NULL COMMENT '创建时间',
  `logical_delete` bit(1) DEFAULT NULL COMMENT '逻辑删除',
  `party_member` bit(1) DEFAULT NULL COMMENT '党员',
  `join_party_time` datetime(6) DEFAULT NULL COMMENT '入党时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='用户';

-- ----------------------------
-- Records of work_user
-- ----------------------------
BEGIN;
INSERT INTO `work_user` (`id`, `username`, `password`, `errPassword`, `phone`, `phoneFlag`, `email`, `emailFlag`, `name`, `sex`, `identification`, `idNum`, `defaultCityID`, `defaultCity`, `tokenExptime`, `regtime`, `category`, `owner`, `enabled`, `userface`, `creator`, `createtime`, `logical_delete`, `party_member`, `join_party_time`) VALUES (2, 'admin', '123', NULL, NULL, b'0', NULL, b'0', NULL, 0, NULL, NULL, NULL, NULL, '2020-04-01 12:12:12', '2021-12-27', 1, NULL, b'1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `work_user` (`id`, `username`, `password`, `errPassword`, `phone`, `phoneFlag`, `email`, `emailFlag`, `name`, `sex`, `identification`, `idNum`, `defaultCityID`, `defaultCity`, `tokenExptime`, `regtime`, `category`, `owner`, `enabled`, `userface`, `creator`, `createtime`, `logical_delete`, `party_member`, `join_party_time`) VALUES (3, 'admin22', '$2a$10$ctQRuuPmCMsFXXGSdKZjE.XCyLb.nrPw19S4IVrihKi.Aelzfs/ka', NULL, NULL, b'0', NULL, b'0', NULL, 0, NULL, NULL, NULL, NULL, '2020-04-01 12:12:12', '2021-12-27', 1, NULL, b'1', NULL, NULL, NULL, NULL, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for work_visitor_appointment
-- ----------------------------
DROP TABLE IF EXISTS `work_visitor_appointment`;
CREATE TABLE `work_visitor_appointment` (
  `id` int NOT NULL AUTO_INCREMENT,
  `visitor_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '访客姓名',
  `visitor_count` int NOT NULL DEFAULT '1' COMMENT '访客数量',
  `visitor_time` datetime NOT NULL COMMENT '访客时间',
  `visitor_plate` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '访客车牌',
  `owner` int DEFAULT NULL COMMENT '所属者',
  `into_village` bit(1) DEFAULT NULL COMMENT '是否进来',
  `into_time` datetime(6) DEFAULT NULL COMMENT '进来时间',
  `green_lighter` int DEFAULT NULL COMMENT '放行人ID',
  `creator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人',
  `create_time` datetime(6) NOT NULL COMMENT '创建时间',
  `logical_delete` bit(1) DEFAULT NULL COMMENT '逻辑删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='访客';

-- ----------------------------
-- Records of work_visitor_appointment
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_worker
-- ----------------------------
DROP TABLE IF EXISTS `work_worker`;
CREATE TABLE `work_worker` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '人员ID',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '名字',
  `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '电话',
  `work_time` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '工作时间区间9:00-17:30',
  `sort` int DEFAULT NULL COMMENT '排序',
  `expense_list` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '可以做的项目id数组',
  `creator` varchar(255) DEFAULT NULL COMMENT '创建人',
  `createtime` datetime DEFAULT NULL COMMENT '创建时间',
  `logical_delete` bit(1) DEFAULT NULL COMMENT '逻辑删除',
  `owner` int DEFAULT NULL COMMENT '所属者',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='维修人员';

-- ----------------------------
-- Records of work_worker
-- ----------------------------
BEGIN;
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
